<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Going</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Going' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../inform7n.html">Inform7</a></li><li><a href="index.html">if</a></li><li><a href="index.html#4">Chapter 4: Actions</a></li><li><b>Going</b></li></ul></div>
<p class="purpose">A feature to provide a little extra support for the "going" action.</p>

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>The "going" action, allowing actors to move from room to room in the spatial
map of the world model, is by far the most intricately implemented. Reflecting
that, we provide quite a lot of hard-wired compiler support for it, in the form
of this feature.
</p>

<p class="commentary">Note that if the actions feature is not also active, none of the functions
below will ever be called.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::start</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">GoingPlugin::start</span></span>:<br/>IF Module - <a href="1-im.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">#</span><span class="identifier-syntax">pragma</span><span class="plain-syntax"> </span><span class="identifier-syntax">clang</span><span class="plain-syntax"> </span><span class="identifier-syntax">diagnostic</span><span class="plain-syntax"> </span><span class="identifier-syntax">push</span>
<span class="plain-syntax">#</span><span class="identifier-syntax">pragma</span><span class="plain-syntax"> </span><span class="identifier-syntax">clang</span><span class="plain-syntax"> </span><span class="identifier-syntax">diagnostic</span><span class="plain-syntax"> </span><span class="identifier-syntax">ignored</span><span class="plain-syntax"> </span><span class="string-syntax">"-Wincompatible-function-pointer-types-strict"</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">NEW_ACTION_NOTIFY_PLUG</span><span class="plain-syntax">, </span><a href="4-gng.html#SP3" class="function-link"><span class="function-syntax">GoingPlugin::new_action_notify</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">WRITE_AP_CLAUSE_ID_PLUG</span><span class="plain-syntax">, </span><a href="4-gng.html#SP5" class="function-link"><span class="function-syntax">GoingPlugin::write_clause_ID</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">ASPECT_OF_AP_CLAUSE_ID_PLUG</span><span class="plain-syntax">, </span><a href="4-gng.html#SP5" class="function-link"><span class="function-syntax">GoingPlugin::aspect</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">DIVERT_AP_CLAUSE_PLUG</span><span class="plain-syntax">, </span><a href="4-gng.html#SP6" class="function-link"><span class="function-syntax">GoingPlugin::divert_clause_ID</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">PARSE_AP_CLAUSE_PLUG</span><span class="plain-syntax">, </span><a href="4-gng.html#SP11" class="function-link"><span class="function-syntax">GoingPlugin::parse_clause</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">VALIDATE_AP_CLAUSE_PLUG</span><span class="plain-syntax">, </span><a href="4-gng.html#SP13" class="function-link"><span class="function-syntax">GoingPlugin::validate</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">NEW_AP_CLAUSE_PLUG</span><span class="plain-syntax">, </span><a href="4-gng.html#SP7" class="function-link"><span class="function-syntax">GoingPlugin::new_clause</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">ACT_ON_ANL_ENTRY_OPTIONS_PLUG</span><span class="plain-syntax">, </span><a href="4-gng.html#SP12" class="function-link"><span class="function-syntax">GoingPlugin::act_on_options</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">COMPARE_AP_SPECIFICITY_PLUG</span><span class="plain-syntax">, </span><a href="4-gng.html#SP16" class="function-link"><span class="function-syntax">GoingPlugin::compare_specificity</span></a><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">SET_PATTERN_MATCH_REQUIREMENTS_PLUG</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">RTGoing::set_pattern_match_requirements</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PluginCalls::plug</span><span class="plain-syntax">(</span><span class="identifier-syntax">COMPILE_PATTERN_MATCH_CLAUSE_PLUG</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">RTGoing::compile_pattern_match_clause</span><span class="plain-syntax">);</span>
<span class="plain-syntax">#</span><span class="identifier-syntax">pragma</span><span class="plain-syntax"> </span><span class="identifier-syntax">clang</span><span class="plain-syntax"> </span><span class="identifier-syntax">diagnostic</span><span class="plain-syntax"> </span><span class="identifier-syntax">pop</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>Firstly, we have to recognise the action we will treat differently, which
we do by its (English) name in the Standard Rules:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;going-action&gt;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">going</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">action_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">going_action</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::new_action_notify</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">GoingPlugin::new_action_notify</span></span>:<br/><a href="4-gng.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">action_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">an</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="function-syntax">&lt;going-action&gt;</span><span class="plain-syntax">(</span><a href="4-ann.html#SP5" class="function-link"><span class="function-syntax">ActionNameNames::tensed</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">an</span><span class="plain-syntax">, </span><span class="identifier-syntax">IS_TENSE</span><span class="plain-syntax">))) </span><span class="identifier-syntax">going_action</span><span class="plain-syntax"> = </span><span class="identifier-syntax">an</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>The going action variables are identified at runtime by this ID number:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="function-syntax">GoingPlugin::id</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">GoingPlugin::id</span></span>:<br/><a href="4-gng.html#SP6">&#167;6</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">going_action</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">going_action</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="identifier-syntax">variables_id</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>We will need to handle five special AP clauses. Two have the existing <span class="extract"><span class="extract-syntax">IN_APCA</span></span>
aspect, and the other three share a new one.
</p>

<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">GOING_FROM_AP_CLAUSE</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">GOING_TO_AP_CLAUSE</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">GOING_THROUGH_AP_CLAUSE</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">GOING_BY_AP_CLAUSE</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">PUSHING_AP_CLAUSE</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">GOING_APCA</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::write_clause_ID</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">GoingPlugin::write_clause_ID</span></span>:<br/><a href="4-gng.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">C</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GOING_FROM_AP_CLAUSE:</span><span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"going-from"</span><span class="plain-syntax">); </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GOING_TO_AP_CLAUSE:</span><span class="plain-syntax">      </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"going-to"</span><span class="plain-syntax">); </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GOING_THROUGH_AP_CLAUSE:</span><span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"going-through"</span><span class="plain-syntax">); </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GOING_BY_AP_CLAUSE:</span><span class="plain-syntax">      </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"going-by"</span><span class="plain-syntax">); </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">PUSHING_AP_CLAUSE:</span><span class="plain-syntax">       </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"pushing"</span><span class="plain-syntax">); </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::aspect</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">GoingPlugin::aspect</span></span>:<br/><a href="4-gng.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">C</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">A</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GOING_FROM_AP_CLAUSE:</span><span class="plain-syntax">    *</span><span class="identifier-syntax">A</span><span class="plain-syntax"> = </span><span class="constant-syntax">IN_APCA</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GOING_TO_AP_CLAUSE:</span><span class="plain-syntax">      *</span><span class="identifier-syntax">A</span><span class="plain-syntax"> = </span><span class="constant-syntax">IN_APCA</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GOING_THROUGH_AP_CLAUSE:</span><span class="plain-syntax"> *</span><span class="identifier-syntax">A</span><span class="plain-syntax"> = </span><span class="constant-syntax">GOING_APCA</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GOING_BY_AP_CLAUSE:</span><span class="plain-syntax">      *</span><span class="identifier-syntax">A</span><span class="plain-syntax"> = </span><span class="constant-syntax">GOING_APCA</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">PUSHING_AP_CLAUSE:</span><span class="plain-syntax">       *</span><span class="identifier-syntax">A</span><span class="plain-syntax"> = </span><span class="constant-syntax">GOING_APCA</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. </b>The Standard Rules defines five action variables in sequence for the going
action, and we pick them up here. Note that we do this by their creation
sequence and not by their names &mdash; so this would all stop working if the
Standard Rules were rearranged. Caveat editor.
</p>

<p class="commentary">If we do spot one of these five magic variables, we tie it to a clause with
a special ID number of our choice.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::divert_clause_ID</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">GoingPlugin::divert_clause_ID</span></span>:<br/><a href="4-gng.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">shared_variable</span><span class="plain-syntax"> *</span><span class="identifier-syntax">stv</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">id</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">oin</span><span class="plain-syntax"> = </span><span class="identifier-syntax">SharedVariables::get_owner_iname</span><span class="plain-syntax">(</span><span class="identifier-syntax">stv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">off</span><span class="plain-syntax"> = </span><span class="identifier-syntax">SharedVariables::get_index</span><span class="plain-syntax">(</span><span class="identifier-syntax">stv</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">going_action</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">oin</span><span class="plain-syntax"> == </span><a href="4-gng.html#SP4" class="function-link"><span class="function-syntax">GoingPlugin::id</span></a><span class="plain-syntax">())) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">off</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">: *</span><span class="identifier-syntax">id</span><span class="plain-syntax"> = </span><span class="constant-syntax">GOING_FROM_AP_CLAUSE</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">1</span><span class="plain-syntax">: *</span><span class="identifier-syntax">id</span><span class="plain-syntax"> = </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span><span class="plain-syntax">: *</span><span class="identifier-syntax">id</span><span class="plain-syntax"> = </span><span class="constant-syntax">GOING_THROUGH_AP_CLAUSE</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">3</span><span class="plain-syntax">: *</span><span class="identifier-syntax">id</span><span class="plain-syntax"> = </span><span class="constant-syntax">GOING_BY_AP_CLAUSE</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="constant-syntax">4</span><span class="plain-syntax">: *</span><span class="identifier-syntax">id</span><span class="plain-syntax"> = </span><span class="constant-syntax">PUSHING_AP_CLAUSE</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. </b>If we create a "going from" or "going to" clause, we set a flag to show that
they can contain regions or rooms equally well. (Inform's kinds system has no
protocol for this; it could have, but we don't need this to be visible to authors
writing source text.)
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::new_clause</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">GoingPlugin::new_clause</span></span>:<br/><a href="4-gng.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">action_pattern</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ap</span><span class="plain-syntax">, </span><span class="reserved-syntax">ap_clause</span><span class="plain-syntax"> *</span><span class="identifier-syntax">apoc</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">apoc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">clause_ID</span><span class="plain-syntax"> == </span><span class="constant-syntax">GOING_FROM_AP_CLAUSE</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">apoc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">clause_ID</span><span class="plain-syntax"> == </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="4-apc.html#SP10" class="function-link"><span class="function-syntax">APClauses::set_opt</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">apoc</span><span class="plain-syntax">, </span><span class="constant-syntax">ALLOW_REGION_AS_ROOM_APCOPT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. </b>Going nowhere is a special syntax:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::go_nowhere</span><span class="plain-syntax">(</span><span class="reserved-syntax">action_pattern</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ap</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::set_spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">Rvalues::new_nothing_object_constant</span><span class="plain-syntax">());</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::going_nowhere</span><span class="plain-syntax">(</span><span class="reserved-syntax">action_pattern</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ap</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Rvalues::is_nothing_object_constant</span><span class="plain-syntax">(</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>And similarly going somewhere:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::go_somewhere</span><span class="plain-syntax">(</span><span class="reserved-syntax">action_pattern</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ap</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::set_spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">Descriptions::from_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_room</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">));</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::going_somewhere</span><span class="plain-syntax">(</span><span class="reserved-syntax">action_pattern</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ap</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Descriptions::is_kind_like</span><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">)) &amp;&amp; (</span><span class="identifier-syntax">Kinds::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">Descriptions::explicit_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">), </span><span class="identifier-syntax">K_room</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. </b>These are recognised by this Preform nonterminal:
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">NOWHERE_AP_CLAUSE_OPTION</span><span class="plain-syntax">   </span><span class="constant-syntax">1</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">SOMEWHERE_AP_CLAUSE_OPTION</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="function-syntax">&lt;going-action-irregular-operand&gt;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">nowhere</span><span class="plain-syntax"> |</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">somewhere</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. </b>Which we intercept thus, and thus avoid the noun being evaluated, but
instead setting the appropriate entry options bit:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::parse_clause</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">GoingPlugin::parse_clause</span></span>:<br/><a href="4-gng.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">action_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">an</span><span class="plain-syntax">, </span><span class="reserved-syntax">anl_clause</span><span class="plain-syntax"> *</span><span class="identifier-syntax">c</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bits</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">c</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">clause_ID</span><span class="plain-syntax"> == </span><span class="constant-syntax">NOUN_AP_CLAUSE</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">an</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">an</span><span class="plain-syntax"> == </span><span class="identifier-syntax">going_action</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="function-syntax">&lt;going-action-irregular-operand&gt;(c-&gt;</span><span class="element-syntax">clause_text</span><span class="plain-syntax">))) { *</span><span class="identifier-syntax">bits</span><span class="plain-syntax"> |= </span><span class="function-syntax">&lt;&lt;r&gt;&gt;</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. </b>Options bits which we later pick up here, moving the irregular noun phrase
into the <span class="extract"><span class="extract-syntax">GOING_TO_AP_CLAUSE</span></span> instead, where we supply our own evaluation:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::act_on_options</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">GoingPlugin::act_on_options</span></span>:<br/><a href="4-gng.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">anl_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">entry</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">entry_options</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">fail</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">entry_options</span><span class="plain-syntax"> &amp; </span><span class="constant-syntax">NOWHERE_AP_CLAUSE_OPTION</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax"> = </span><a href="4-anl.html#SP17" class="function-link"><span class="function-syntax">ActionNameLists::get_clause_wording</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">entry</span><span class="plain-syntax">, </span><span class="constant-syntax">NOUN_AP_CLAUSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="4-anl.html#SP20" class="function-link"><span class="function-syntax">ActionNameLists::truncate_clause</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">entry</span><span class="plain-syntax">, </span><span class="constant-syntax">NOUN_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="4-anl.html#SP17" class="function-link"><span class="function-syntax">ActionNameLists::has_clause</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">entry</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">)) *</span><span class="identifier-syntax">fail</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><a href="4-anl.html#SP18" class="function-link"><span class="function-syntax">ActionNameLists::set_clause_wording</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">entry</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">anl_clause</span><span class="plain-syntax"> *</span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><a href="4-anl.html#SP17" class="function-link"><span class="function-syntax">ActionNameLists::get_clause</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">entry</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">c</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">evaluation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Rvalues::new_nothing_object_constant</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">entry_options</span><span class="plain-syntax"> &amp; </span><span class="constant-syntax">SOMEWHERE_AP_CLAUSE_OPTION</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax"> = </span><a href="4-anl.html#SP17" class="function-link"><span class="function-syntax">ActionNameLists::get_clause_wording</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">entry</span><span class="plain-syntax">, </span><span class="constant-syntax">NOUN_AP_CLAUSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="4-anl.html#SP20" class="function-link"><span class="function-syntax">ActionNameLists::truncate_clause</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">entry</span><span class="plain-syntax">, </span><span class="constant-syntax">NOUN_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="4-anl.html#SP17" class="function-link"><span class="function-syntax">ActionNameLists::has_clause</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">entry</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">)) *</span><span class="identifier-syntax">fail</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><a href="4-anl.html#SP18" class="function-link"><span class="function-syntax">ActionNameLists::set_clause_wording</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">entry</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">W</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">anl_clause</span><span class="plain-syntax"> *</span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><a href="4-anl.html#SP17" class="function-link"><span class="function-syntax">ActionNameLists::get_clause</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">entry</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">c</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">evaluation</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Descriptions::from_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">K_room</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP13" class="paragraph-anchor"></a><b>&#167;13. </b>Here we perform sanity checks on the clauses.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::validate</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">GoingPlugin::validate</span></span>:<br/><a href="4-gng.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">action_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">an</span><span class="plain-syntax">, </span><span class="reserved-syntax">anl_clause</span><span class="plain-syntax"> *</span><span class="identifier-syntax">c</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">outcome</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">keyword</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">; </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ka</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, *</span><span class="identifier-syntax">kb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">c</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">clause_ID</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GOING_FROM_AP_CLAUSE:</span><span class="plain-syntax"> </span><span class="identifier-syntax">keyword</span><span class="plain-syntax"> = </span><span class="string-syntax">"from"</span><span class="plain-syntax">; </span><span class="identifier-syntax">ka</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_room</span><span class="plain-syntax">; </span><span class="identifier-syntax">kb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_region</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GOING_TO_AP_CLAUSE:</span><span class="plain-syntax"> </span><span class="identifier-syntax">keyword</span><span class="plain-syntax"> = </span><span class="string-syntax">"to"</span><span class="plain-syntax">; </span><span class="identifier-syntax">ka</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_room</span><span class="plain-syntax">; </span><span class="identifier-syntax">kb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_region</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GOING_BY_AP_CLAUSE:</span><span class="plain-syntax"> </span><span class="identifier-syntax">keyword</span><span class="plain-syntax"> = </span><span class="string-syntax">"by"</span><span class="plain-syntax">; </span><span class="identifier-syntax">ka</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_thing</span><span class="plain-syntax">; </span><span class="identifier-syntax">kb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">GOING_THROUGH_AP_CLAUSE:</span><span class="plain-syntax"> </span><span class="identifier-syntax">keyword</span><span class="plain-syntax"> = </span><span class="string-syntax">"through"</span><span class="plain-syntax">; </span><span class="identifier-syntax">ka</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_door</span><span class="plain-syntax">; </span><span class="identifier-syntax">kb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">PUSHING_AP_CLAUSE:</span><span class="plain-syntax"> </span><span class="identifier-syntax">keyword</span><span class="plain-syntax"> = </span><span class="string-syntax">"with"</span><span class="plain-syntax">; </span><span class="identifier-syntax">ka</span><span class="plain-syntax"> = </span><span class="identifier-syntax">K_thing</span><span class="plain-syntax">; </span><span class="identifier-syntax">kb</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">; </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">keyword</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    *</span><span class="identifier-syntax">outcome</span><span class="plain-syntax"> = </span><a href="4-gng.html#SP14" class="function-link"><span class="function-syntax">GoingPlugin::check_clause</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">c</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">evaluation</span><span class="plain-syntax">, </span><span class="identifier-syntax">keyword</span><span class="plain-syntax">, </span><span class="identifier-syntax">ka</span><span class="plain-syntax">, </span><span class="identifier-syntax">kb</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP14" class="paragraph-anchor"></a><b>&#167;14. </b>Each clause can be within one of up to two kinds, or else can be "nothing"
or unspecified:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">PM_GoingWrongKind_issued_at</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">PM_GoingWithoutObject_issued_at</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::check_clause</span><button class="popup" onclick="togglePopup('usagePopup11')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup11">Usage of <span class="code-font"><span class="function-syntax">GoingPlugin::check_clause</span></span>:<br/><a href="4-gng.html#SP13">&#167;13</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">spec</span><span class="plain-syntax">, </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">keyword</span><span class="plain-syntax">, </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ka</span><span class="plain-syntax">, </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kb</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">spec</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Rvalues::is_nothing_object_constant</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Specifications::is_description_like</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">instance</span><span class="plain-syntax"> *</span><span class="identifier-syntax">oref</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Specifications::object_exactly_described_if_any</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">oref</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">ka</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">Instances::of_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">oref</span><span class="plain-syntax">, </span><span class="identifier-syntax">ka</span><span class="plain-syntax">)) ||</span>
<span class="plain-syntax">            ((</span><span class="identifier-syntax">kb</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Instances::of_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">oref</span><span class="plain-syntax">, </span><span class="identifier-syntax">kb</span><span class="plain-syntax">)))) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">PM_GoingWrongKind_issued_at</span><span class="plain-syntax"> == </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">PM_GoingWrongKind_issued_at</span><span class="plain-syntax"> = </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_object</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">oref</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_text</span><span class="plain-syntax">(3, </span><span class="identifier-syntax">keyword</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(4, </span><span class="identifier-syntax">ka</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(5, </span><span class="identifier-syntax">Instances::to_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">oref</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">kb</span><span class="plain-syntax">) </span><span class="identifier-syntax">Problems::quote_kind</span><span class="plain-syntax">(6, </span><span class="identifier-syntax">kb</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_GoingWrongKind</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">kb</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"In the sentence %1, %2 seems to be intended as something the "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"player might be going %3, but this has the wrong kind: %5 "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"rather than %4 or %6."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="string-syntax">"In the sentence %1, %2 seems to be intended as something the player "</span>
<span class="plain-syntax">            </span><span class="string-syntax">"might be going %3, but this has the wrong kind: %5 rather than %4."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">PM_GoingWithoutObject_issued_at</span><span class="plain-syntax"> == </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">PM_GoingWithoutObject_issued_at</span><span class="plain-syntax"> = </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_source</span><span class="plain-syntax">(1, </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_wording</span><span class="plain-syntax">(2, </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">spec</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::quote_text</span><span class="plain-syntax">(3, </span><span class="identifier-syntax">keyword</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">StandardProblems::handmade_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(), </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_GoingWithoutObject</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_segment</span><span class="plain-syntax">(</span>
<span class="plain-syntax">        </span><span class="string-syntax">"In the sentence %1, '%2' seems to be intended as something the player "</span>
<span class="plain-syntax">        </span><span class="string-syntax">"might be going %3, but it doesn't make sense in that context."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Problems::issue_problem_end</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP15" class="paragraph-anchor"></a><b>&#167;15. </b>Going from, by, through, or with all imply going somewhere rather than nowhere;
if no "going to" destination is specified, we had better check the destination
to make sure it actually exists. So this can be used to see if the need arises:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::need_to_check_destination_exists</span><span class="plain-syntax">(</span><span class="reserved-syntax">action_pattern</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ap</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">) == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">            ((</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_FROM_AP_CLAUSE</span><span class="plain-syntax">) != </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">            (</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_BY_AP_CLAUSE</span><span class="plain-syntax">) != </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">            (</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_THROUGH_AP_CLAUSE</span><span class="plain-syntax">) != </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">            (</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap</span><span class="plain-syntax">, </span><span class="constant-syntax">PUSHING_AP_CLAUSE</span><span class="plain-syntax">) != </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP16" class="paragraph-anchor"></a><b>&#167;16. </b>Specificity checking for the "going" action is quite complicated. We want to
count "going from X" and "going in X" as being essentially the same requirement,
giving neither clause priority over the other, which means some fiddly crossover
code if <span class="extract"><span class="extract-syntax">ap1</span></span> has one and <span class="extract"><span class="extract-syntax">ap2</span></span> the other.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">GoingPlugin::compare_specificity</span><button class="popup" onclick="togglePopup('usagePopup12')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup12">Usage of <span class="code-font"><span class="function-syntax">GoingPlugin::compare_specificity</span></span>:<br/><a href="4-gng.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">action_pattern</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="reserved-syntax">action_pattern</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ap2</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">rv</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ignore_in</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">Specifications::law</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"III.2.4 - Action/Where/Other Optional Clauses"</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">rct1</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP16" class="function-link"><span class="function-syntax">APClauses::number_with_aspect</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_APCA</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">rct2</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP16" class="function-link"><span class="function-syntax">APClauses::number_with_aspect</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap2</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_APCA</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">rct1</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">rct2</span><span class="plain-syntax">) { *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">rct1</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">rct2</span><span class="plain-syntax">) { *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = -1; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; }</span>

<span class="plain-syntax">    *</span><span class="identifier-syntax">ignore_in</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP19" class="function-link"><span class="function-syntax">APClauses::cmp_clause</span></a><span class="plain-syntax">(</span><span class="constant-syntax">PUSHING_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap2</span><span class="plain-syntax">); </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">rv</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP19" class="function-link"><span class="function-syntax">APClauses::cmp_clause</span></a><span class="plain-syntax">(</span><span class="constant-syntax">GOING_BY_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap2</span><span class="plain-syntax">); </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">rv</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP19" class="function-link"><span class="function-syntax">APClauses::cmp_clause</span></a><span class="plain-syntax">(</span><span class="constant-syntax">GOING_THROUGH_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap2</span><span class="plain-syntax">); </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">rv</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">Specifications::law</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"III.2.2 - Action/Where/Room Where Action Takes Place"</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">rct1</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP16" class="function-link"><span class="function-syntax">APClauses::number_with_aspect</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="constant-syntax">IN_APCA</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">rct2</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP16" class="function-link"><span class="function-syntax">APClauses::number_with_aspect</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap2</span><span class="plain-syntax">, </span><span class="constant-syntax">IN_APCA</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">rct1</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">rct2</span><span class="plain-syntax">) { *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">rct1</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">rct2</span><span class="plain-syntax">) { *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = -1; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">; }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">suspend_usual_from_and_room</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_FROM_AP_CLAUSE</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">        (</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="constant-syntax">IN_AP_CLAUSE</span><span class="plain-syntax">) == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap2</span><span class="plain-syntax">, </span><span class="constant-syntax">IN_AP_CLAUSE</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">        (</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap2</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_FROM_AP_CLAUSE</span><span class="plain-syntax">) == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP19" class="function-link"><span class="function-syntax">APClauses::cmp_clauses</span></a><span class="plain-syntax">(</span><span class="constant-syntax">GOING_FROM_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="constant-syntax">IN_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">rv</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">suspend_usual_from_and_room</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap2</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_FROM_AP_CLAUSE</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">        (</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap2</span><span class="plain-syntax">, </span><span class="constant-syntax">IN_AP_CLAUSE</span><span class="plain-syntax">) == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="constant-syntax">IN_AP_CLAUSE</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">        (</span><a href="4-apc.html#SP7" class="function-link"><span class="function-syntax">APClauses::spec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_FROM_AP_CLAUSE</span><span class="plain-syntax">) == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP19" class="function-link"><span class="function-syntax">APClauses::cmp_clauses</span></a><span class="plain-syntax">(</span><span class="constant-syntax">IN_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="constant-syntax">GOING_FROM_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">rv</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">suspend_usual_from_and_room</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">suspend_usual_from_and_room</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP19" class="function-link"><span class="function-syntax">APClauses::cmp_clause</span></a><span class="plain-syntax">(</span><span class="constant-syntax">GOING_FROM_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap2</span><span class="plain-syntax">); </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">rv</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP19" class="function-link"><span class="function-syntax">APClauses::cmp_clause</span></a><span class="plain-syntax">(</span><span class="constant-syntax">IN_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap2</span><span class="plain-syntax">); </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">rv</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    *</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><a href="4-apc.html#SP19" class="function-link"><span class="function-syntax">APClauses::cmp_clause</span></a><span class="plain-syntax">(</span><span class="constant-syntax">GOING_TO_AP_CLAUSE</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap1</span><span class="plain-syntax">, </span><span class="identifier-syntax">ap2</span><span class="plain-syntax">); </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">rv</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="4-nap.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-im.html">1</a></li><li class="progresschapter"><a href="2-bd.html">2</a></li><li class="progresschapter"><a href="3-sm.html">3</a></li><li class="progresscurrentchapter">4</li><li class="progresssection"><a href="4-ap.html">ap</a></li><li class="progresssection"><a href="4-anaa.html">anaa</a></li><li class="progresssection"><a href="4-ak.html">ak</a></li><li class="progresssection"><a href="4-ac.html">ac</a></li><li class="progresssection"><a href="4-act.html">act</a></li><li class="progresssection"><a href="4-as.html">as</a></li><li class="progresssection"><a href="4-av.html">av</a></li><li class="progresssection"><a href="4-ann.html">ann</a></li><li class="progresssection"><a href="4-ap2.html">ap2</a></li><li class="progresssection"><a href="4-anl.html">anl</a></li><li class="progresssection"><a href="4-apc.html">apc</a></li><li class="progresssection"><a href="4-pap.html">pap</a></li><li class="progresssection"><a href="4-pc.html">pc</a></li><li class="progresssection"><a href="4-ea.html">ea</a></li><li class="progresssection"><a href="4-nap.html">nap</a></li><li class="progresscurrent">gng</li><li class="progresssection"><a href="4-rpoa.html">rpoa</a></li><li class="progresschapter"><a href="5-pp.html">5</a></li><li class="progresschapter"><a href="6-dlg.html">6</a></li><li class="progressnext"><a href="4-rpoa.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

